package models

import "gorm.io/gorm"

type Answer struct {
	gorm.Model
	QuestionID uint   `json:"question_id" gorm:"not null"`
	Text       string `json:"text" gorm:"type:varchar(255);not null"`
	IsCorrect  bool   `json:"is_correct" gorm:"not null"`
}

func (a *Answer) TableName() string {
	return "tbl_answers"
}

func NewAnswer(text string, isCorrect bool) *Answer {
	return &Answer{Text: text, IsCorrect: isCorrect}
}
